package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.model.entity.MyCertificateEntity;
import com.runen.infinitemovement.tool.GlideUtils;

import java.util.List;

public class MyCredentialAdapter extends BaseQuickAdapter<MyCertificateEntity.DataBean.CertificatesBean, BaseViewHolder> {
    private Context context;

    public MyCredentialAdapter(Context context) {
        super(R.layout.item_my_credential);
        this.context = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, MyCertificateEntity.DataBean.CertificatesBean item) {
        RelativeLayout ll_lock = helper.getView(R.id.ll_lock);
        if (item.got) {
            ll_lock.setVisibility(View.GONE);
        } else {
            ll_lock.setVisibility(View.VISIBLE);
        }
        TextView tv_hozom = helper.getView(R.id.tv_tinder);
        tv_hozom.setText(String.valueOf("奖励火种x" + item.tinder));
        ImageView iv_url = helper.getView(R.id.iv_url);
        GlideUtils.loadImage(context, item.medalUrl, iv_url);

    }
}
